package com.redstar.HappyRefresh.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
public class Permission implements Serializable { // 权限

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    //逻辑删除，0未删除，1删除，默认为0
    @TableLogic
    private Boolean isDeleted;

    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreated;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtUpdated;

    private Long pId; // 树形结构中对应的父节点的id，0为根节点

    private String path; // 权限对应的操作

    private String href; // 菜单对应的页面路径

    private String icon; // 图标

    private String name; // 权限名

    private Integer isMenu; // -1为目录，0为菜单，1为按钮

    private Integer sort; // 排序

    private Integer state; // 状态

    @TableField(exist = false)
    private List<Permission> children; // 子节点


}
